home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / test / test_sha.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2005-10-18  |  1KB  |  34 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. import sha
  5. import unittest
  6. from test import test_support
  7.  
  8. class SHATestCase(unittest.TestCase):
  9.     
  10.     def check(self, data, digest):
  11.         computed = sha.new(data).hexdigest()
  12.         self.assert_(computed == digest)
  13.  
  14.     
  15.     def test_case_1(self):
  16.         self.check('abc', 'a9993e364706816aba3e25717850c26c9cd0d89d')
  17.  
  18.     
  19.     def test_case_2(self):
  20.         self.check('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', '84983e441c3bd26ebaae4aa1f95129e5e54670f1')
  21.  
  22.     
  23.     def test_case_3(self):
  24.         self.check('a' * 1000000, '34aa973cd4c4daa4f61eeb2bdbad27316534016f')
  25.  
  26.  
  27.  
  28. def test_main():
  29.     test_support.run_unittest(SHATestCase)
  30.  
  31. if __name__ == '__main__':
  32.     test_main()
  33.  
  34.